import request from '@/utils/request'

// 获取接班列表
export function getSuccessionRecordList(params) {
  return request({
    url: '/operation/web/records/succession_record_list',
    method: 'get',
    params
  })
}

// 创建接班记录
export function createSuccessionRecord(data) {
  return request({
    url: '/operation/web/records/succession_record',
    method: 'post',
    data
  })
}

// 修改接班记录
export function updateSuccessionRecord(data) {
  return request({
    url: '/operation/web/records/succession_record',
    method: 'put',
    data
  })
}

// 删除接班记录
export function deleteSuccessionRecord(id) {
  return request({
    url: `/operation/web/records/succession_record/${id}`,
    method: 'delete'
  })
}

// 获取未接班的交班记录下拉列表
export function getUnSuccessionList() {
  return request({
    url: '/operation/web/records/shift_handover_list/un_succession',
    method: 'get'
  })
}

// 获取接班详细信息
export function getSuccessionRecordDetail(id) {
  return request({
    url: `/operation/web/records/succession_record/${id}`,
    method: 'get'
  })
}

// 获取用户下拉列表
export function getUserList() {
  return request({
    url: '/operation/web/records/userList',
    method: 'get'
  })
}

